<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>生命周期钩子</title>
</head>
<body>
<div id="app">
{{msg}}
</div>

<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var vm = new Vue({
        el:"#app",
        data:{
            msg:'hi vue'
        },
        beforeCreate:function () {
            console.log('beforeCreate')
        },
        created:function () {
            console.log('created')
        },
        beforeMount:function () {
            console.log('beforeMount')
        },
        mounted:function (){
            console.log('mounted')
        },
        beforeUpdate:function () {
            console.log('beforeUpdate')
        },
        updated:function () {
            console.log('updated')
        }
    })
    setTimeout(function (){
        vm.msg = "change...";
    },3000)
</script>
</body>
</html>